import request from '@/utils/request'

// 修改学期管理
export function setCurSemester(name) {
  // console.log("js say: " + name);
  return request({
    url: '/jwxt/semester/set',
    method: 'get',
    params: { name: name }
  })
}

// 查询学期管理列表
export function listSemester(query) {
  return request({
    url: '/jwxt/semester/list',
    method: 'get',
    params: query
  })
}

// 查询学期管理详细
export function getSemester(id) {
  return request({
    url: '/jwxt/semester/' + id,
    method: 'get'
  })
}

// 新增学期管理
export function addSemester(data) {
  return request({
    url: '/jwxt/semester',
    method: 'post',
    data: data
  })
}

// 修改学期管理
export function updateSemester(data) {
  return request({
    url: '/jwxt/semester',
    method: 'put',
    data: data
  })
}

// 删除学期管理
export function delSemester(id) {
  return request({
    url: '/jwxt/semester/' + id,
    method: 'delete'
  })
}

//获取当前学期
export function getCurSemester(){
  return request({
    url:'/system/config/configKey/jwxt.curSemester',
    method: 'get'
  })
}
